﻿using System.Windows.Forms;

namespace System.Windows.Forms
{
	public static class Extensions
	{
		public static TreeNode GetSourceTreeNode(this ContextMenuStrip menu)
		{
			var _tv = menu.SourceControl as TreeView;
			
			return
				null != _tv
					? _tv.GetNodeAt(_tv.PointToClient(menu.Location))
					: null;
		}
	}
}
